﻿<%@ Page Language="C#" MasterPageFile="~/Shared/Masters/Form.master" AutoEventWireup="true" 
CodeFile="EvaluateAdd.aspx.cs" Inherits="Modules_Personal_EvaluateAdd" Title="绩效评分" Theme ="Default" %>


<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>
<%@ Register TagPrefix="web" TagName="listtitle" Src="~/Shared/UserControls/ListTitle.ascx" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<%@ Register Assembly="YYControls" Namespace="YYControls" TagPrefix="yyc" %>

<asp:Content ID="Content1" ContentPlaceHolderID="idScript" Runat="Server">

 <style type="text/css">
    .brk1
    {
      word-wrap: break-word;
      word-break: break-all;
    }
     .brk2
    {    
      white-space:pre;
    }
  </style>


 <script type="text/javascript">
        function closeForm() {
            window.returnValue="false";
            window.opener=null;
            window.close();
            return true;
        } 
        
           function sureDelete()
        {
             return confirm("您确认要录入该指标评分吗?");        
        }                      
        
       
    </script>
    <script src="../../Scripts/DatePicker/WdatePicker.js" language="javascript" type="text/javascript"></script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="idFormMain" Runat="Server">

 <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>    
  <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <contenttemplate>
        <%--  <div class="crumb">
        <asp:Label runat="server" ID="lblTitle" Text="考核人选择"></asp:Label>
    </div>--%>
    
      <div id="divUser" runat="server">
        <div class="search" id="search">
            <table cellpadding="2" cellspacing="0" class="rtm_shb_b">
                <tr>                 
                    <td style="width: 100px;">
                        <asp:Label runat="server" ID="lblName" Text="名称:"></asp:Label>
                      <asp:TextBox ID="txtName" runat="server"></asp:TextBox>
                    </td>                   
                     
                    <td class="rtm_shb_btn" style="white-space: nowrap">
                        <asp:Button ID="btnSearch" runat="server" Text="查询" OnClick="btnSearch_Click"></asp:Button>&nbsp;                      
                    </td>
                </tr>
            </table>
        </div>
        <div class="toolbar" id="toolbar">
         <%--   <h2>
                <web:listtitle ID="Listtitle1" runat="server" Title="考核人信息列表" />
            </h2>  --%>
              <asp:LinkButton ID="btnConfirm" runat="server" OnClick="btnConfirm_Click"  >
                <asp:Label ID="lblCreatNew" runat="server" Text="">
                    <img runat="server" id="imgNew" src="../../Images/icon_new.gif" style="border: 0px" />确认</asp:Label>
            </asp:LinkButton>          
        </div>
        <yyc:SmartGridView ID="gvUserList" runat="server" AutoGenerateColumns="False"
            AllowSorting="True" OnSorting="gvUserList_Sorting" OnRowCommand="gvUserList_RowCommand"
            OnRowDataBound="gvUserList_RowDataBound" EmptyDataText="没有找到数据!">
           
            <Columns>     
                        <asp:TemplateField HeaderText="选择" >
                                <ItemTemplate>
                                    <input type="radio" name="chkSelected" value='<%# Eval("ID") %>' />
                                </ItemTemplate>
                                  <ItemStyle Width="5%" />
                            </asp:TemplateField>
              
                <asp:TemplateField HeaderText="被考核人" SortExpression="Target_User_ID">
                    <itemtemplate>
                <asp:Label runat="server" Text='<%# GetUserName(Eval("Target_User_ID"))%>'  CssClass="text_overflow"  ID="lblTarget_User_ID"></asp:Label>
                </itemtemplate>
                    <headerstyle wrap="False" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="指标套" SortExpression="TargetOwner_ID">
                    <itemtemplate>
                <asp:Label runat="server" Text='<%# GetTargetOwner(Eval("TargetOwner_ID"))%>'  CssClass="text_overflow"  ID="lblTargetOwner_ID"></asp:Label>
                </itemtemplate>
                    <headerstyle wrap="False" />
                </asp:TemplateField>               
            </Columns>
        </yyc:SmartGridView>
        <webdiyer:AspNetPager ID="AspNetPager" CssClass="aspNetPager" ShowBoxThreshold="1"
            runat="server" HorizontalAlign="Right" PageSize="10" AlwaysShow="True" FirstPageText="首页"
            LastPageText="尾页" NextPageText="下一页" PrevPageText="上一页" Width="98%" CustomInfoClass="aspNetPager"
            LayoutType="Div" PageIndexBoxType="TextBox" ShowPageIndexBox="Auto" OnPageChanged="AspNetPager_PageChanged">
        </webdiyer:AspNetPager>
    </div>
    </contenttemplate> 
    </asp:UpdatePanel>
    
  <asp:UpdatePanel ID="UpdatePanel2" runat="server">
        <contenttemplate>
        <div id="divDetail" runat="server"  style="overFlow-x: auto; OVERFLOW: scroll; overFlow-y:auto;" align="center">
        <asp:HiddenField ID="hidEvaluateID" runat="server"></asp:HiddenField>
        <table cellpadding='2' cellspacing='1' class='ow_fim_mg' width="100%"  >
                <tr>
                    <td class='fi_l'>
                        <asp:Label ID="lbCode" runat="server" Text="被考核人:" ></asp:Label>
                     
                    </td>
                    <td class='fi_r'>
                         <asp:Label ID="txtUser" runat="server" ></asp:Label>
                        
                    </td>
                    
                </tr>
                <tr>
                    <td class='fi_l'>
                        <asp:Label ID="lblRemark" runat="server" Text="指标:" ></asp:Label>
                    </td>
                    <td class='fi_r' >
                     <yyc:SmartGridView ID="gvTarget" runat="server" AutoGenerateColumns="False"
            AllowSorting="True" OnSorting="gvTarget_Sorting" OnRowCommand="gvTarget_RowCommand"
            OnRowDataBound="gvTarget_RowDataBound" EmptyDataText="没有找到数据!" Width="98%" >
           
            <Columns>                             
              
        <asp:TemplateField HeaderText="指标名称" SortExpression="Target_ID"  >
                    <itemtemplate>
                  <asp:HiddenField runat="server" ID='HidTargetID' Value='<%# Eval("Target_ID")%>' />
                <asp:Label runat="server" Text='<%# Eval("Name")%>'   ID="lblsTarget_ID"  ></asp:Label>
                </itemtemplate>
                  
                </asp:TemplateField>
              <%-- <asp:BoundField DataField="Name" HeaderText="指标名称" ItemStyle-Width="100px" />
               --%>
                 <asp:TemplateField HeaderText="指标分数" SortExpression="Target_ID">
                    <itemtemplate>
                    
              <asp:Label runat="server" ID="lblScore" Text='<%# Eval("Score") %>'  ></asp:Label>
                </itemtemplate>
                    <itemstyle />
                </asp:TemplateField>
               
                  <asp:TemplateField HeaderText="分数" >
                    <itemtemplate>
           
            <asp:TextBox runat="server" ID="txtScore" Text='<%# Eval("Score")%>' width="30px"></asp:TextBox>
            <%-- <asp:CompareValidator ID="cvScore" runat="server" ControlToValidate="txtScore" ErrorMessage="分值不能为0"                           Operator="NotEqual" Type="Double" ValueToCompare="0" ValidationGroup="oss"></asp:CompareValidator>--%>
                </itemtemplate>
                    <itemstyle />
                </asp:TemplateField>   
                
                      <asp:TemplateField HeaderText="发生次数" >
                    <itemtemplate>
                    
                      <asp:LinkButton ID="btnCreate" runat="server"  Text='<%# GetNum(Eval("Target_ID")) %>' CommandName="his" CommandArgument='<%# Eval("Target_ID") %>'  CausesValidation="False" ></asp:LinkButton>
              
           
           
                    
<%--           <a id="aNum" runat="server" href='<%# GetLink(Eval("Target_ID"))%>'> <asp:Label runat="server" ID="lblNum" Text='<%# GetNum(Eval("Target_ID")) %>' CssClass="text_overflow" ></asp:Label></a>  
--%>                </itemtemplate>
                    <itemstyle />
                </asp:TemplateField>
                
                <asp:TemplateField HeaderText="录入时间" >
                    <itemtemplate>
               <input class="Wdate" type="text" style="width: 100px;" id="txtDate" runat="server"
                            onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})" />
                </itemtemplate>
                    <itemstyle  />
                </asp:TemplateField>   
                
               <%-- <asp:TemplateField HeaderText="评分" >
                    <itemtemplate>
                <asp:TextBox runat="server"  ID="txtScore"></asp:TextBox>
                </itemtemplate>
                    <headerstyle wrap="False" />
                </asp:TemplateField>  --%> 
                 <asp:TemplateField HeaderText="备注" >
                    <itemtemplate>
                <asp:TextBox runat="server"  ID="txtRemark"></asp:TextBox>
                </itemtemplate>
                    <itemstyle />
                </asp:TemplateField>   
                
                 <asp:TemplateField HeaderText="操作">
                    <itemtemplate>     
                      <table width="46px" style="text-align: left">                    
                        <tr>   
                            <td style="border: 0px solid #fff;">
                    <asp:LinkButton runat="server" CommandName="input" CommandArgument='<%# Eval("Target_ID") %>'  CausesValidation="False"  OnClientClick="return sureDelete();"  Text="录入" ToolTip="录入" ID="ibtnInput" ValidationGroup="oss"></asp:LinkButton>
                      </td>
                       </tr>
                       </table>
                </itemtemplate>
                </asp:TemplateField>
                          
            </Columns>
        </yyc:SmartGridView>
                    <webdiyer:AspNetPager ID="AspNetPager2" CssClass="aspNetPager" ShowBoxThreshold="1"
            runat="server" HorizontalAlign="Right" PageSize="8" AlwaysShow="True" FirstPageText="首页"
            LastPageText="尾页" NextPageText="下一页" PrevPageText="上一页"  CustomInfoClass="aspNetPager"
            LayoutType="Div" PageIndexBoxType="TextBox" ShowPageIndexBox="Auto" Width="98%" OnPageChanged="AspNetPager2_PageChanged">
        </webdiyer:AspNetPager>   
                    
                        </td>                
                </tr>   
                      
            </table>
        </div>
        <asp:HiddenField ID="hidFinAssID" runat="server"></asp:HiddenField>
      </contenttemplate>
        </asp:UpdatePanel>

<asp:UpdatePanel ID="UpdatePanel3" runat="server">
        <contenttemplate>
        
        <div id="divHis" runat="server" style="display:none;overFlow-x: auto; OVERFLOW: scroll; overFlow-y:auto;" align="center"">
        <table cellpadding='2' cellspacing='1' class='ow_fim_mg' width="100%">
               
                <tr>                   
                    <td class='fi_r' colspan="2">
                     <yyc:SmartGridView ID="gvHis" runat="server" AutoGenerateColumns="False"
            AllowSorting="True"  EmptyDataText="没有找到数据!" Width="98%">
           
            <Columns>                             
              
                <asp:TemplateField HeaderText="指标名称" SortExpression="Target_ID">
                    <itemtemplate>                 
                <asp:Label runat="server" Text='<%# Eval("Name")%>'  CssClass="text_overflow"  ID="lblsTarget_IDs"></asp:Label>
                </itemtemplate>
                
                    <headerstyle wrap="False" />
                </asp:TemplateField>
                
                  <asp:TemplateField HeaderText="分数" >
                    <itemtemplate>
              <asp:Label runat="server" ID="lblScores" Text='<%# Eval("Score") %>' CssClass="text_overflow" ></asp:Label>
                </itemtemplate>
                    <headerstyle wrap="False" />
                </asp:TemplateField> 
                
                
                <asp:TemplateField HeaderText="录入人" >
                    <itemtemplate>
              <asp:Label ID="lblUserID" runat="server" Text='<%# GetUserName(Eval("User_ID"))%>'></asp:Label>
                </itemtemplate>
                    <headerstyle wrap="False" />
                </asp:TemplateField>   
                
                
                <asp:TemplateField HeaderText="录入时间" >
                    <itemtemplate>
              <asp:Label ID="lblTime" runat="server" Text='<%#  Convert.ToDateTime(Eval("InsertTime").ToString()).ToString("yyyy-MM-dd")%>'></asp:Label>
                </itemtemplate>
                    <headerstyle wrap="False" />
                </asp:TemplateField>   
            
                 <asp:TemplateField HeaderText="备注" >
                    <itemtemplate>
              <asp:Label runat="server" Text='<%# Eval("Remark")%>' ID="lblRemarks"></asp:Label>
                </itemtemplate>
                    <headerstyle wrap="False" />
                </asp:TemplateField>   
               
            </Columns>
        </yyc:SmartGridView>
                    <webdiyer:AspNetPager ID="AspNetPagerHis" CssClass="aspNetPager" ShowBoxThreshold="1"
            runat="server" HorizontalAlign="Right" PageSize="5" AlwaysShow="True" FirstPageText="首页"
            LastPageText="尾页" NextPageText="下一页" PrevPageText="上一页" Width="98%" CustomInfoClass="aspNetPager"
            LayoutType="Div" PageIndexBoxType="TextBox" ShowPageIndexBox="Auto" OnPageChanged="AspNetPagerHis_PageChanged">
        </webdiyer:AspNetPager>   
                    
                        </td>                
                </tr>   
                      
            </table>
        </div>
        
        </contenttemplate>
        </asp:UpdatePanel>
    
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="idFormButton" Runat="Server">
  <asp:Button ID="btnSave" runat="server" Text="保存"  ValidationGroup="Flow" Visible="false"
        OnClick="btnSave_Click" />
    <asp:Button ID="CloseButton" runat="server" Text="关闭" 
        OnClientClick="return closeForm();" />   
</asp:Content>

